home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Compilers / digital marsC compier / dm / include / assert.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-07-18  |  984 b   |  58 lines

  1.  
  2. /* Copyright (C) 1986-2001 by Digital Mars. $Revision: 1.1.1.1 $ */
  3. #if __DMC__ || __RCC__
  4. #pragma once
  5. #endif
  6.  
  7. #ifndef __ASSERT_H
  8. #define __ASSERT_H 1
  9.  
  10. #if __cplusplus
  11. extern "C" {
  12. #endif
  13.  
  14.  
  15. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  16. #ifndef _CRTAPI1
  17. #define _CRTAPI1 __cdecl
  18. #endif
  19.  
  20.  
  21. /* Define _CRTAPI2 (for compatibility with the NT SDK) */
  22. #ifndef _CRTAPI2
  23. #define _CRTAPI2 __cdecl
  24. #endif
  25.  
  26. /* Define CRTIMP */
  27. #ifndef _CRTIMP
  28. #if defined(_WIN32) && defined(_DLL)
  29. #define _CRTIMP  __declspec(dllimport)
  30. #else
  31. #define _CRTIMP
  32. #endif
  33. #endif
  34.  
  35.  
  36. #undef assert
  37.  
  38. #ifdef NDEBUG
  39.     #define assert(ignore)    ((void) 0)
  40. #else
  41.     #define assert(e)    ((void)((e) || (_assert(#e,__FILE__,__LINE__),1)))
  42.     extern void
  43.     #ifdef __STDC__
  44.     #elif __OS2__ && __INTSIZE == 4
  45.     __stdcall
  46.     #else
  47.     __cdecl
  48.     #endif
  49.         _assert(void *,void *,unsigned);
  50.     #pragma noreturn(_assert)
  51. #endif
  52.  
  53. #if __cplusplus
  54. }
  55. #endif
  56.  
  57. #endif
  58.